Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@sumor/i18n
Advanced tools
This is a lightweight i18n library for Node.js and the browser. You can easily use it to manage your i18n resources. And apply it to your project.
A Sumor Cloud Tool.
More Documentation
This is a lightweight i18n library for Node.js and the browser. You can easily use it to manage your i18n resources. And apply it to your project.
npm i @sumor/i18n --save
Require Node.JS version 18.x or above
As this package is written in ES module,
please change the following code in your package.json
file:
{
"type": "module"
}
import getI18n from '@sumor/i18n'
const i18nConfig = {
en: {
demo: {
hello: 'Hello',
welcome: 'Welcome',
greeting: 'Hello, {name}',
test: 'Test'
}
},
zh: {
demo: {
hello: '你好',
welcome: '欢迎'
}
},
'zh-TW': {
demo: {
hello: '妳好',
greeting: '妳好, {name}'
}
}
}
const i18n = getI18n('zh-TW', i18nConfig)
// match zh-TW
console.log(i18n('demo.hello')) // 妳好
console.log(i18n('demo.greeting', { name: 'John' })) // 妳好, John
// match zh
console.log(i18n('demo.welcome')) // 欢迎
// match en
console.log(i18n('demo.test')) // Test
FAQs
This is a lightweight i18n library for Node.js and the browser. You can easily use it to manage your i18n resources. And apply it to your project.
We found that @sumor/i18n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.